import reqwest from 'reqwest';

function reqwestFetch(url,params,callback,method = 'POST') {
  reqwest({
    url: url,
    method: method,
    data: params,
    type:'json',
    withCredentials: false,
    success: (data) => {
      console.log(data);
      if(data.code == 886) {

      }else {
        callback();
      }
    },
    error: (err) => {
      console.log(err);
    }
  })
}

export default reqwestFetch;
